home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mac-Source 1994 July
/
Mac-Source_July_1994.iso
/
C and C++
/
Text⁄Files
/
File List 14
/
Main.h
< prev
next >
Wrap
Text File
|
1990-09-14
|
6KB
|
211 lines
/*
FileList 1.4
"FileList.h"
*/
/* 'STR ' resourde IDs */
#define CREATOR 128 /* Application type */
#define SAVENAME 129 /* Default filename */
#define HEADER_FILES 130 /* Header files window */
#define HEADER_VOLUMES 131 /* Header volumes window */
#define SAVE_FILE_AS 132 /* Save file as */
#define TITLE_FILES 133 /* Title files window */
#define TITLE_VOLUMES 134 /* Title volumes window */
#define SAVE_TEXT_AS 135 /* Save text as */
#define OPTION_FILE 136 /* Option file name */
#define OPTIONS 137 /* Option file type */
#define TEXT_CREATOR 138 /* TEXT file creator */
#define ERR_OLD 256 /* Old system */
#define ERR_MEMORY 257 /* No memory */
#define ERR_DISK 258 /* Disk error */
/* 'ALRT' and 'DLOG' resource IDs */
#define MessageDialog 129 /* Used for error messages */
#define SaveDialog 130 /* Save before...? */
#define SaveOk 1
#define SaveNo 2
#define SaveCancel 3
#define SelectDialog 132 /* List of volumes to read */
#define SelectOk 1
#define SelectCancel 2
#define SelectVolume 3
#define SelectCount 8
#define SelectEject 11
/* 'MENU' resource IDs */
#define AppleMenu 128
#define aAbout 1
#define FileMenu 129
#define fNew 1
#define fOpen 2
#define fClose 3
#define fSave 4
#define fSaveAs 5
#define fSaveText 6
#define fWindow 8
#define fOptions 9
#define fQuit 11
#define EditMenu 130
#define eUndo 1
#define eCut 3
#define eCopy 4
#define ePaste 5
#define eClear 6
#define eFind 8 /* Find */
#define eAgain 9 /* Find again */
#define eSelection 10 /* Move to selection */
#define eItems 10
#define VolumeMenu 131
#define vAuto 1
#define vAdd 2
#define vDelete 3
#define vRename 4
#define vItems 4
#define FSortMenu 132
#define fsName 1
#define fsSize 2
#define fsType 3
#define fsCrea 4
#define fsCdate 5
#define fsMdate 6
#define fsVol 7
#define fsPath 8
#define FSORT_MAX 8
#define VSortMenu 133
#define vsName 1
#define vsFree 2
#define vsTotal 3
#define vsFiles 4
#define vsCdate 5
#define vsMdate 6
#define VSORT_MAX 6
/* Types and constants */
typedef struct { /* Data related to a window: */
WindowRecord window; /* - the window */
ControlHandle vs; /* - vertical scroll handle */
ControlHandle hs; /* - horizontal scroll handle */
short descent; /* - descent height */
short height; /* - height of one text line */
short width; /* - width of one text column */
short maxsort; /* - number of sorts */
short sorted; /* - sorted by */
MenuHandle sortmenu; /* - sort menu */
short title; /* - resource id of title */
short header; /* - resource id of header */
void (*redraw)(); /* - redraw routine */
void (*sort)(); /* - sort routine */
void (*string)(); /* - text string routine */
long *base; /* - array with info record offsets */
long select; /* - selected record */
long count; /* - current number of records */
long max; /* - maximum number of records */
unsigned short percent; /* - percentage of records */
Rect rectangle; /* - initial window port rectangle */
short columns; /* - maximal number of columns */
short vrefnum; /* - used by last save text */
unsigned char fname[64]; /* - used by last save text */
unsigned char find[32]; /* - find string */
unsigned long creator; /* - find creator */
unsigned long type; /* - find type */
Boolean (*match)(); /* - Match procedure */
} WindowData, *WindowDataPtr, **WindowDataHdl;
#define VERSION 1L
/* Globals */
#ifdef GLOBALS
Boolean WNE; /* WaitNextEvent implemented */
Boolean notQuiting; /* Set to FALSE if quiting */
Rect Bounds; /* Screen bounds */
long Creator; /* Creator of application */
long Options; /* Options file type */
long TextCreator; /* Text file creator */
MenuHandle AppleM; /* Apple menu */
MenuHandle FileM; /* File menu */
MenuHandle EditM; /* Edit menu */
MenuHandle VolumeM; /* Volume menu */
Ptr InfoBase; /* Huge memory block with info records */
unsigned long InfoSize; /* Current size of info block */
unsigned long InfoMax; /* Maximal size of info block */
unsigned long InfoCount; /* Current number of info records */
unsigned long Heap; /* Heap space needed */
unsigned short Record; /* Average record name */
WindowData FileData; /* File window data */
WindowData VolumeData; /* Volume window data */
Boolean Automatic; /* Automatic volume mode */
Boolean Stuffit; /* Recognize StuffIt archives */
Boolean Compactor; /* Recognize Compactor archives */
Boolean Dirty; /* If not yet saved */
short VrefNum; /* Used by last save */
unsigned char Fname[64]; /* Used by last save */
short SysVol; /* System volume reference number */
short ApplVol; /* Application volume reference number */
short SysVRefNum; /* System folder */
Boolean Tabs; /* Save text with tabs */
short DateFormat[3]; /* Date format */
unsigned char EmptyStr[] = "\p";
unsigned char CrStr[] = "\p\r";
unsigned char SpStr[] = "\p ";
#else
extern Boolean WNE;
extern Boolean notQuiting;
extern Rect Bounds;
extern long Creator;
extern long Options;
extern long TextCreator;
extern MenuHandle AppleM;
extern MenuHandle FileM;
extern MenuHandle EditM;
extern MenuHandle VolumeM;
extern Ptr InfoBase;
extern unsigned long InfoSize;
extern unsigned long InfoMax;
extern unsigned long InfoCount;
extern unsigned long Heap;
extern unsigned short Record;
extern WindowData FileData;
extern WindowData VolumeData;
extern Boolean Automatic;
extern Boolean Stuffit;
extern Boolean Compactor;
extern Boolean Dirty;
extern short VrefNum;
extern unsigned char Fname[64];
extern short SysVol;
extern short ApplVol;
extern short SysVRefNum;
extern Boolean Tabs;
extern short DateFormat[];
extern unsigned char EmptyStr[];
extern unsigned char CrStr[];
extern unsigned char SpStr[];
#endif
/* Prototypes */
void ClearSorted (WindowDataPtr);
pascal void Crash (void);
void DoClose (WindowPeek);
void DoClose1 (WindowPtr);
void DoDisk (unsigned long);
void DoQuit (void);
void DoSort (WindowDataPtr, short);
void Message (short, short);
void NewTitle (WindowDataPtr);
Boolean SaveBefore (void);
void Update (void);